#pragma once
#include<iostream>
#include<functional>
#include<pthread.h>
#include<string>
template<class T>
using func_t = std::function<void(T&)>;
template<class T>
class Thread
{
    public:
    Thread(const std::string &threadname,func_t<T> func,T &data)
    :_tid(0)
    ,_threadname(threadname)
    ,_isrunning(false)
    ,_func(func)
    ,_data(data)
    {}
    private:
    pthread_t _tid;
    std::string _threadname;
    bool _isrunning;
    func_t<T> _func;
    T _data;
}